<?php

/**
 * Comment form base class.
 *
 * @method Comment getObject() Returns the current form's model object
 *
 * @package    myarticles
 * @subpackage form
 * @author     Apul Gupta<apulmca2k4@gmail.com>
 */
abstract class BaseCommentForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'email_id'    => new sfWidgetFormInputText(),
      'web_url'     => new sfWidgetFormInputText(),
      'name'        => new sfWidgetFormInputText(),
      'article_id'  => new sfWidgetFormPropelChoice(array('model' => 'Article', 'add_empty' => true)),
      'total_votes' => new sfWidgetFormInputText(),
      'total_users' => new sfWidgetFormInputText(),
      'content'     => new sfWidgetFormTextarea(),
      'is_abused'   => new sfWidgetFormInputCheckbox(),
      'created_at'  => new sfWidgetFormDateTime(),
      'updated_at'  => new sfWidgetFormDateTime(),
      'is_active'   => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'Comment', 'column' => 'id', 'required' => false)),
      'email_id'    => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'web_url'     => new sfValidatorString(array('max_length' => 500, 'required' => false)),
      'name'        => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'article_id'  => new sfValidatorPropelChoice(array('model' => 'Article', 'column' => 'id', 'required' => false)),
      'total_votes' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'total_users' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'content'     => new sfValidatorString(array('required' => false)),
      'is_abused'   => new sfValidatorBoolean(array('required' => false)),
      'created_at'  => new sfValidatorDateTime(array('required' => false)),
      'updated_at'  => new sfValidatorDateTime(array('required' => false)),
      'is_active'   => new sfValidatorBoolean(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('comment[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Comment';
  }


}
